function* createIterator(arr) {
  for(const item of arr) {
    yield item
  }
}

const name = ["ghg","tuyu","gf","gdfg","sdsd","jjj"]
const iterator = createIterator(name)

console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
console.log(iterator.next());
